 <%@ taglib prefix="s" uri="/struts-tags"%> 
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

 
<html >
<head>
 	   <link href="../../../css/Public.css"type="text/css" rel="stylesheet" />
       <link href="../../../css/PublicEdit.css"type="text/css" rel="stylesheet" /> 
       <SCRIPT type="text/javascript" src="/js/address.js"></SCRIPT>
<title>新增商家 </title>
<script>
			function checkData()
			{	
				var merinfo_ksFullName= window.document.getElementById("merinfo_ksFullName").value;	
			        if(merinfo_ksFullName!=null && merinfo_ksFullName!="")
			        {		
			        	//限制 字符和数字、长度
			        	if(merinfo_ksFullName.length>15)
			        	{
			        	 	alert("商家全名过长，最长15位！");
			        	 	window.document.getElementById("merinfo_ksFullName").focus();
			           		window.event.returnValue = false;
			            	return;
			        	}	  
			        }
			        else
			        {            
			            alert("请输入中文名！");
			            window.event.returnValue = false;
			            return;
			        }		
					//验证数据   新用户名称
					var uname= window.document.getElementById("merinfo_ksMerName").value;	
			        if(uname!=null && uname!="")
			        {		
			        	//限制 字符和数字、长度
			        	if(uname.length>15)
			        	{
			        	 	alert("用户名过长，最长15位！");
			           		window.event.returnValue = false;
			            	return;
			        	}	  
			        	
			         <c:forEach var="blist" items="${list_MerInfo}">				  		         
			         	if(uname=="${blist.merName}")
			 			 {
			     			 alert("该用户名已经存在！");
			     			 window.event.returnValue = false;
				  			 return;
					  	}		  
        			  </c:forEach>	     		
			        }
			        else
			        {            
			            alert("请输入用户名！");
			            window.event.returnValue = false;
			            return;
			        }		
			        
		 			//验证数据   密码
					var merinfo_ksPwd= window.document.getElementById("merinfo_ksPwd").value;	
			        if(merinfo_ksPwd!=null && merinfo_ksPwd!="")
			        {		
			       	 	if(merinfo_ksPwd.length>18||merinfo_ksPwd.length<6)
			        	{
			        	  	alert("用户密码长度为6-18位！");
			        	  	window.document.getElementById("merinfo_ksPwd").focus();
			           	 	window.event.returnValue = false;
			            	return;
			        	}	       	       		
			        }
			        else
			        {            
			             alert("请输入密码！");
			             window.event.returnValue = false;
			             return;
			        }				       
        			  
        			  //商务编号不能重复			
			        var merinfo_ksMerNo=window.document.getElementById("merinfo_ksMerNo").value;			        
        			if(merinfo_ksMerNo!=null && merinfo_ksMerNo!="")
			        {		
			        	//限制 字符和数字、长度
			        	if(merinfo_ksMerNo.length>15)
			        	{
			        	 	alert("用户编号长度过长，最长15位！");
			        	 	window.document.getElementById("merinfo_ksMerNo").focus();
			           	 	window.event.returnValue = false;
			            	return;
			        	}	
			        	 <c:forEach var="blist" items="${list_MerInfo}">				         
			         	if(merinfo_ksMerNo=="${blist.ksMerNo}")
			 			 {
			     			 alert("该用户编号已经存在！");
			     			 window.event.returnValue = false;
				  			 return;
					  	}	
        			  </c:forEach>	  
			        }		
        			var merinfo_ksMerIdentify=window.document.getElementById("merinfo_ksMerIdentify").value;			        
        			if(merinfo_ksMerIdentify!=null && merinfo_ksMerIdentify!="")
			        {		
			        	//限制 字符和数字、长度
			        	if(merinfo_ksMerIdentify.length>100)
			        	{
			        	 	alert("用户备注过长，最长100！");
			        	 	window.document.getElementById("merinfo_ksMerIdentify").focus();
			           	 	window.event.returnValue = false;
			            	return;
			        	}	  
			        }			
					//电话要符合
        			var merinfo_ksPhone=window.document.getElementById("merinfo_ksPhone").value;			        
        			if(merinfo_ksPhone!=null && merinfo_ksPhone!="")
			        {		
			        	//限制 字符和数字、长度
			        	if(merinfo_ksPhone.length>11)
			        	{
			        	 	alert("号码有误，最长11！");
			        	 	window.document.getElementById("merinfo_ksPhone").focus();
			           	 	window.event.returnValue = false;
			            	return;
			        	}	  
			        }					 		        		      
			}						
 </script>		
</head>
<body onload="javascript:loadData('pro','city','area');">
<form action="/admin/merchant/savemer" method="post">
				<div>
		                <div class="l_f_top">
		                    <div class="l_f_top_left_div"><img alt="" src="../../../images/tb.gif" width="16" height="16" /></div>
		                    <div class="l_f_top_right_div">新增商家        </div>
		                </div>
		                <div class="l_f_body"> 
		                  <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                            商家全称:</div>
		                        <div class="l_f_body_div5">
				                       <input type="text"  name ="merinfo_ksFullName" id="merinfo_ksFullName" style="width:120px"/>  
					           </div>                      
		                    </div>	  
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                            用户名:</div>
		                        <div class="l_f_body_div5">
				                       <input type="text"  name ="merinfo_ksMerName" id="merinfo_ksMerName" style="width:120px"/>  
					           </div>                      
		                    </div>	 		                  
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                              密码:</div>
		                        <div class="l_f_body_div5" >
		               		      <input type="password"  name ="merinfo_ksPwd" id="merinfo_ksPwd" style="width:120px""/>  
							   </div>
		                    </div>
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                            用户编号:</div>
		                        <div class="l_f_body_div5">
				                       <input type="text"  name ="merinfo_ksMerNo" id="merinfo_ksMerNo" style="width:120px"/>  
					           </div>                      
		                    </div>	
		                    <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                              用户组:</div>
		                        <div class="l_f_body_div5" >
		               		     <select name="merinfo_ksMerGroup" id="merinfo_ksMerGroup" style="width: 120px">
											<option value="1">技术人员</option>											
											<option value="2">运营人员</option>	
											<option value="3">管理人员</option>
											<option value="4">系统配置人员</option>
								</select>
							   </div>
		                    </div>
		                    <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                              商家电话:</div>
		                        <div class="l_f_body_div5" >
		               		      <input type="text"  name ="merinfo_ksPhone" id="merinfo_ksPhone" style="width:120px"/>  
							   </div>
		                    </div>
		                    <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                              商家地址:</div>
		                        <div class="l_f_body_div5" >
		               		     <table>
									  <tr>
									  	<td>省</td><td><select id="pro" name="pro" onchange="javascript:chProvance('pro','city','area')"></select></td>
									  	<td>市</td><td><select id="city" name="selcity" onchange="javascript:chCity('city','area')"></select></td>
									  	<td>区</td><td><select id="area" name="area"></select></td>
									  	</tr>
									  	</table>
							   </div>
							   <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                              详细地址:</div>
		                        <div class="l_f_body_div5" >
		                       		 <textarea rows="3" cols="30" name ="merinfo_ksDetailAdd" id="merinfo_ksDetailAdd"></textarea><SPAN>(不用写省市区)</SPAN>
		                        </div>
		                    </div>
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                            备注:</div>
		                        <div class="l_f_body_div5">
				                       <input type="text"  name ="merinfo_ksMerIdentify" id="merinfo_ksMerIdentify"  style="width:360px" /> 
				                     
					           </div>       
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                              用户状态:</div>
		                        <div class="l_f_body_div5" >
		               		     <select name="merinfo_ksMerStatus" id="merinfo_ksMerStatus" style="width: 120px">
									<option value="0">冻结</option>								
									<option value="1" selected>推荐</option>	
									<option value="2">后置</option>						
									<option value="3">正常</option>						
								</select>
							   </div>
		                    </div>
		                     <div class="center l_f_body_foot">			                     
		                       <input type="submit" id="button" name="button" class="button2_60" onclick="checkData();"  value="提交"/>		                      
		                      <input type="button" class="button2_60"  onclick="javascript:history.go(-1);" value=" 返回"/> 
		                 </div>
		                </div>
			    	</div> 
			   </div>
</form>
</body>
</html>